/*
 * Description: 文件存储服务
 * Author: wangyifei
 * DateCreated: 2024-06-07 15:51
 */

import { type IRes, minioHttp } from '@/utils/request';

// 单文件上传
export interface UploadRes {
	etag: string;
	ext: string;
	id: number;
	name: string;
	path: string;
	size: number;
	url: string;
}
export const uploadFile = (data: FormData) =>
	minioHttp.post<IRes<UploadRes>>({
		url: '/upload',
		data,
		ignoreSource: true
	});
